﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<fivescomplement.Models.GetInstitutionResults_Result  >>" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Institution Results
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Institution Results</h2>
   
        <% using (Html.BeginForm()) { %>

                <fieldset>
                 <% if (Model.Count() > 0)
                    { %>
                    <table>
                        <tr>
                            <th>Course</th>
                            <th>Instructor</th>
                            <th>Term</th>
                            <th>Year</th>
                        </tr>
                    <% foreach (var item in Model)
                       { %>
                        <tr>
                            <td>
                            <%: Html.ActionLink(item.CourseName, "Course", new { id = item.CourseName })%> 
                            </td>
                            <td>
                            <%: Html.ActionLink(item.InstructorsLastname + ", " + item.InstructorsFirstName, "Instructor", new { id = item.InstructorsFirstName + ' ' + item.InstructorsLastname })%> 

                            </td>
                            <td>
                            <%: item.Term%>
                            </td>
                            <td>
                            <%: item.Year%>
                            </td>
                        </tr>
    
                    <% } %>
                    
                    </table>
                
                <% } %>
                <% else
                    { %>
                <% } %>
                </fieldset>
            </div>
        <% } %>
    </body>
</html>
</asp:Content>